Skip to content

feat(webapp,core,cli): filter runs by region in dashboard, API, and MCP#3612

Open
ericallam wants to merge 1 commit into
mainfrom
feat/runs-list-region-filter
Open

feat(webapp,core,cli): filter runs by region in dashboard, API, and MCP#3612
ericallam wants to merge 1 commit into
mainfrom
feat/runs-list-region-filter

Conversation

@ericallam
Copy link
Copy Markdown
Member

@ericallam ericallam commented May 13, 2026

Summary

Adds a Region column and Region filter (under More filters) to the runs list dashboard, the same filter on the public runs list API (filter[region]), and a matching region input on the MCP list_runs tool. Each run's executing region is also surfaced as a new optional region field on the runs list and run retrieve responses, populated from the worker instance group's masterQueue identifier.

Useful when you run tasks across multiple regions and want to slice the runs list — or your existing run-querying scripts — by where the run actually executed.

Design

The filter value in the URL / API is the masterQueue identifier (the same string already persisted on TaskRun and replicated to ClickHouse as worker_queue), so the query just becomes worker_queue IN (...) with no server-side translation. The Region dropdown options come from a new resource loader backed by RegionsPresenter, which now also exposes masterQueue alongside the existing region metadata.

// public API
const runs = await runs.list({ region: ["us-east-1", "eu-west-1"] });
// each item: { id, status, ..., region?: "us-east-1" }
// MCP
list_runs({ environment: "prod", region: "us-east-1" })

Test plan

  • Dashboard: open the runs list, confirm the new Region column renders the friendly region name (or for legacy runs with empty masterQueue).
  • Dashboard: open More filters → Region, multi-select a couple of regions, confirm the URL gains ?regions=<masterQueue> and the list narrows.
  • Combine with Queues / Statuses / time filters — no interaction regressions.
  • API: GET /api/v1/runs?filter[region]=<masterQueue> returns only matching runs, and each item has a region field set.
  • API: GET /api/v1/runs/<id> returns region for a run that has a non-empty workerQueue.
  • MCP: call list_runs with region: "..."; verify the formatted output line includes region:<value>.

This is part 1 of 5 in a stack made with GitButler:

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 13, 2026

🦋 Changeset detected

Latest commit: ccb3018

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 32 packages
Name Type
trigger.dev Patch
@trigger.dev/core Patch
@trigger.dev/sdk Patch
references-ai-chat Patch
d3-chat Patch
references-d3-openai-agents Patch
references-nextjs-realtime Patch
references-realtime-hooks-test Patch
references-realtime-streams Patch
references-telemetry Patch
@trigger.dev/build Patch
@trigger.dev/plugins Patch
@trigger.dev/python Patch
@trigger.dev/redis-worker Patch
@trigger.dev/schema-to-json Patch
@internal/cache Patch
@internal/clickhouse Patch
@internal/llm-model-catalog Patch
@trigger.dev/rbac Patch
@internal/redis Patch
@internal/replication Patch
@internal/run-engine Patch
@internal/schedule-engine Patch
@internal/testcontainers Patch
@internal/tracing Patch
@internal/tsql Patch
@internal/zod-worker Patch
@internal/sdk-compat-tests Patch
@trigger.dev/react-hooks Patch
@trigger.dev/rsc Patch
@trigger.dev/database Patch
@trigger.dev/otlp-importer Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

Review Change Stack

Walkthrough

This PR adds region filtering and display capabilities to the runs API and webapp. It extends run schemas with an optional region field, implements region-based filtering throughout the backend via repository and presenter layers, loads available regions for the UI, and adds a new RegionLabel component and region filter menu to the runs table and filters. The region column is conditionally displayed based on environment type (hidden in development), and the CLI tools are extended to support region filtering. All changes are documented in release changesets.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding region filtering and display across dashboard, API, and MCP tools.
Description check ✅ Passed The description is largely complete with summary, design rationale, and a detailed test plan, though some template sections are missing or incomplete.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/runs-list-region-filter

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ericallam ericallam force-pushed the feat/runs-list-region-filter branch 2 times, most recently from 125a478 to cd003da Compare May 13, 2026 15:15
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 36ccf22 to a90949b Compare May 13, 2026 15:46
@ericallam ericallam force-pushed the feat/runs-list-region-filter branch 3 times, most recently from aac03ef to 4fb9480 Compare May 13, 2026 21:56
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 75369f3 to cf2fa07 Compare May 14, 2026 09:11
@ericallam ericallam force-pushed the feat/runs-list-region-filter branch from 4fb9480 to eb1cffa Compare May 14, 2026 09:19
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from cf2fa07 to fef74f4 Compare May 14, 2026 09:33
@ericallam ericallam force-pushed the feat/runs-list-region-filter branch from eb1cffa to df25e74 Compare May 14, 2026 09:33
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from fef74f4 to 343c204 Compare May 14, 2026 11:06
@ericallam ericallam force-pushed the feat/runs-list-region-filter branch from df25e74 to cd06bb3 Compare May 14, 2026 11:06
@ericallam ericallam marked this pull request as ready for review May 14, 2026 11:07
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

View 2 additional findings in Devin Review.

Open in Devin Review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Missing regions in hasFilters check prevents "Clear all filters" button from appearing

The hasFilters variable in RunsFilters (apps/webapp/app/components/runs/v3/RunFilters.tsx:377-389) determines whether the "Clear all filters" button is shown. The PR added regions as a new filter type throughout the codebase (filter menu, applied filter pill, search params parsing, ClickHouse query, etc.) but did not add searchParams.has("regions") to this check. When a user applies only a region filter, the "Clear all filters" button will not appear, leaving the user without a quick way to reset filters.

(Refers to lines 377-389)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

variant?: TableVariant;
disableAdjacentRows?: boolean;
additionalTableState?: Record<string, string>;
regions?: { masterQueue: string; name: string; location?: string }[];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Other TaskRunsTable call sites don't pass regions prop — graceful fallback

The TaskRunsTable component is used in three other routes (errors, waitpoints, schedules) that don't pass the new regions prop. Since regions defaults to undefined and the regionByMasterQueue map is built from regions ?? [], this is safe. The region column will still appear for non-DEVELOPMENT environments, but will show raw masterQueue strings (e.g. 'us-east-1') instead of friendly names with flag icons. This is an acceptable degradation — the data is still correct, just less pretty.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

triggerFunction: resolveTriggerFunction(run),
batchId: run.batch?.friendlyId,
metadata,
region: run.workerQueue || undefined,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 ApiRetrieveRunPresenter exposes workerQueue as region for both detail and related runs

In createCommonRunStructure at apps/webapp/app/presenters/v3/ApiRetrieveRunPresenter.server.ts:467, region: run.workerQueue || undefined is set. Since commonRunSelect now includes workerQueue: true and createCommonRunStructure is used for both the main run and related runs (parent/root/children), the region field will appear on all related run objects in the API response. The workerQueue column has a Prisma @default("main") so it will always have a value — meaning region will be set to "main" for most runs rather than undefined. This is the || undefined check using falsy, and since "main" is truthy, it will pass through. This seems intentional but worth noting: even runs that haven't been assigned to a specific region will show "main" as their region.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 343c204 to 480c5ea Compare May 14, 2026 12:13
@ericallam ericallam force-pushed the feat/runs-list-region-filter branch from cd06bb3 to f13d871 Compare May 14, 2026 12:13
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 480c5ea to 8954526 Compare May 14, 2026 12:30
@ericallam ericallam force-pushed the feat/runs-list-region-filter branch from f13d871 to 73a1b2e Compare May 14, 2026 12:30
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 8954526 to 289ab08 Compare May 14, 2026 12:32
@ericallam ericallam force-pushed the feat/runs-list-region-filter branch from 73a1b2e to a6c3bfc Compare May 14, 2026 12:32
ericallam added a commit that referenced this pull request May 14, 2026
…3542)

## Summary

A `/sessions` dashboard for inspecting durable Sessions, an `AGENT` /
`SCHEDULED` task-kind filter for the runs list, and the server-side
hardening (rate-limit exemption for packets, retry-with-backoff on
stream appends, typed too-large-chunk error) that the `chat.agent`
runtime in #3543 needs. Builds on the Sessions primitive shipped in
#3417.

## Design

The Sessions list + detail routes mirror the run inspector pattern.
`TaskTriggerSource` gains `AGENT` and `SCHEDULED` values, persisted on
`BackgroundWorker.taskKind` and `TaskRun.taskKind` (plus a matching
Clickhouse column), so the runs list can filter by kind.

New `@trigger.dev/core` modules — `sessionStreams`, `inputStreams`, a
`sessionStreamInstance` for realtime streams, and the
`realtime-streams-api` / `session-streams-api` surfaces — expose the
typed shapes that chat.agent will use to drive `session.out`.
`ChatChunkTooLargeError` lets the runtime drop oversized chunks with a
typed surface instead of failing the run. `s2Append` retries transient
failures with exponential backoff. `/api/v[12]/packets/*` is exempt from
customer rate limits so chat snapshot reads and writes don't get
throttled under load.

## Stack

Part of a 4-PR stack. Merge bottom-up.

1. **This PR** (#3542) → `main`
2. #3543#3542 — `chat.agent` runtime + browser transport
3. #3545#3543 — agent-view dashboard
4. #3546#3545 — ai-chat reference + MCP tooling

Replaces #3173 (closed).

<!-- GitButler Footer Boundary Top -->
---
This is **part 5 of 5 in a stack** made with GitButler:
- <kbd>&nbsp;5&nbsp;</kbd> #3612
- <kbd>&nbsp;4&nbsp;</kbd> #3546
- <kbd>&nbsp;3&nbsp;</kbd> #3545
- <kbd>&nbsp;2&nbsp;</kbd> #3543
- <kbd>&nbsp;1&nbsp;</kbd> #3542 👈 
<!-- GitButler Footer Boundary Bottom -->
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 289ab08 to e373556 Compare May 14, 2026 12:45
@ericallam ericallam force-pushed the feat/runs-list-region-filter branch from a6c3bfc to 899e37f Compare May 14, 2026 12:45
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 4 additional findings in Devin Review.

Open in Devin Review

Comment on lines +328 to +330
if (options.regions && options.regions.length > 0) {
queryBuilder.where("worker_queue IN {regions: Array(String)}", { regions: options.regions });
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 ClickHouse vs Prisma data inconsistency for pre-existing runs' region values

The Prisma schema defines workerQueue String @default("main"), so all pre-existing PostgreSQL rows have workerQueue = "main". However, the ClickHouse column worker_queue defaults to "" (empty string) per taskRuns.ts:50. The new ClickHouse filter (clickhouseRunsRepository.server.ts:328-330) queries worker_queue IN {regions}, which means filtering by region "main" would miss pre-migration ClickHouse rows (which have worker_queue = ""). Meanwhile, the dashboard table reads from Prisma and shows "main" for those same runs. This inconsistency only matters for runs created before the worker_queue column was populated in ClickHouse.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from e373556 to 55d9543 Compare May 14, 2026 13:11
@ericallam ericallam force-pushed the feat/runs-list-region-filter branch from 899e37f to 95abd6c Compare May 14, 2026 13:11
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 55d9543 to 2cd4c8f Compare May 14, 2026 14:11
@ericallam ericallam force-pushed the feat/runs-list-region-filter branch from 95abd6c to 2075e5e Compare May 14, 2026 14:11
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 2cd4c8f to d3f90d7 Compare May 14, 2026 14:31
@ericallam ericallam force-pushed the feat/runs-list-region-filter branch from 2075e5e to 0da7de8 Compare May 14, 2026 14:31
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from d3f90d7 to 43e9f21 Compare May 14, 2026 14:58
@ericallam ericallam force-pushed the feat/runs-list-region-filter branch from 0da7de8 to a2f958b Compare May 14, 2026 14:58
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 43e9f21 to c252b96 Compare May 14, 2026 15:46
@ericallam ericallam force-pushed the feat/runs-list-region-filter branch from a2f958b to 2a28ac0 Compare May 14, 2026 15:46
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from c252b96 to 6f62bc9 Compare May 14, 2026 15:59
@ericallam ericallam force-pushed the feat/runs-list-region-filter branch from 2a28ac0 to ac2d3de Compare May 14, 2026 15:59
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 6f62bc9 to ccadd9f Compare May 14, 2026 16:09
@ericallam ericallam force-pushed the feat/runs-list-region-filter branch from ac2d3de to c13927e Compare May 14, 2026 16:09
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from ccadd9f to 9acd6cd Compare May 14, 2026 16:25
@ericallam ericallam force-pushed the feat/runs-list-region-filter branch from c13927e to 270e95c Compare May 14, 2026 16:25
@ericallam ericallam force-pushed the feature/ai-chat-reference-and-cli branch from 9acd6cd to 8673d42 Compare May 14, 2026 16:39
@ericallam ericallam force-pushed the feat/runs-list-region-filter branch from 270e95c to 2493552 Compare May 14, 2026 16:40
Base automatically changed from feature/ai-chat-reference-and-cli to main May 14, 2026 16:55
Adds a "Region" column and "Region" filter (under More filters) to the runs
list, plus the same filter on the public runs list API (filter[region]) and
the MCP list_runs tool (region input). Each run's executing region is
exposed as a new optional region field on the runs list and run retrieve
responses, populated from the worker instance group's masterQueue
identifier.
@ericallam ericallam force-pushed the feat/runs-list-region-filter branch from 2493552 to ccb3018 Compare May 15, 2026 07:30
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/webapp/app/components/runs/v3/RunFilters.tsx (1)

377-390: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Include region in hasFilters so “Clear all filters” works for region-only states.

At Line 377–390, hasFilters omits searchParams.has("regions"). With only a region filter active, the clear-all button is hidden; in development this is worse because the region chip is hidden too, making recovery from a copied URL state difficult from the UI.

💡 Suggested fix
   const hasFilters =
     searchParams.has("statuses") ||
     searchParams.has("tasks") ||
     searchParams.has("bulkId") ||
     searchParams.has("tags") ||
     searchParams.has("batchId") ||
     searchParams.has("runId") ||
     searchParams.has("scheduleId") ||
     searchParams.has("queues") ||
+    searchParams.has("regions") ||
     searchParams.has("machines") ||
     searchParams.has("versions") ||
     searchParams.has("errorId") ||
     searchParams.has("sources");
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/webapp/app/components/runs/v3/RunFilters.tsx` around lines 377 - 390,
The hasFilters computation is missing regions so the "Clear all filters" UI
doesn't appear when only a region is selected; update the hasFilters expression
(used in RunFilters) to include searchParams.has("regions") so that the
clear-all button and region chip state behave correctly when regions is the only
active filter.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@apps/webapp/app/components/runs/v3/RunFilters.tsx`:
- Around line 377-390: The hasFilters computation is missing regions so the
"Clear all filters" UI doesn't appear when only a region is selected; update the
hasFilters expression (used in RunFilters) to include
searchParams.has("regions") so that the clear-all button and region chip state
behave correctly when regions is the only active filter.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: bb7956da-3761-4853-a1f7-2bbee9c6838b

📥 Commits

Reviewing files that changed from the base of the PR and between ac02c0f and ccb3018.

📒 Files selected for processing (22)
  • .changeset/mcp-list-runs-region.md
  • .changeset/runs-list-region-filter.md
  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/components/runs/v3/RegionLabel.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/presenters/RunFilters.server.ts
  • apps/webapp/app/presenters/v3/ApiRetrieveRunPresenter.server.ts
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts
  • apps/webapp/app/presenters/v3/RegionsPresenter.server.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.regions.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
  • apps/webapp/app/services/runsRepository/clickhouseRunsRepository.server.ts
  • apps/webapp/app/services/runsRepository/runsRepository.server.ts
  • packages/cli-v3/src/mcp/formatters.ts
  • packages/cli-v3/src/mcp/schemas.ts
  • packages/cli-v3/src/mcp/tools/runs.ts
  • packages/core/src/v3/apiClient/index.ts
  • packages/core/src/v3/apiClient/types.ts
  • packages/core/src/v3/schemas/api.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (28)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: sdk-compat / Node.js 22.12 (ubuntu-latest)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: sdk-compat / Cloudflare Workers
  • GitHub Check: internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: sdk-compat / Bun Runtime
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: sdk-compat / Node.js 20.20 (ubuntu-latest)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: sdk-compat / Deno Runtime
  • GitHub Check: packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: typecheck / typecheck
🧰 Additional context used
📓 Path-based instructions (12)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Use types over interfaces for TypeScript
Avoid using enums; prefer string unions or const objects instead

**/*.{ts,tsx}: Import from @trigger.dev/core subpaths only, never from the root. Subpath imports must be used to maintain proper module boundaries.
When writing Trigger.dev tasks, always import from @trigger.dev/sdk. Never use @trigger.dev/sdk/v3 or deprecated client.defineJob.
Prisma is version 6.14.0. Use the Prisma client from internal-packages/database for all database operations.
For ClickHouse client, schema migrations, and analytics queries, use internal-packages/clickhouse.

Files:

  • packages/cli-v3/src/mcp/formatters.ts
  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/services/runsRepository/runsRepository.server.ts
  • packages/cli-v3/src/mcp/schemas.ts
  • apps/webapp/app/components/runs/v3/RegionLabel.tsx
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
  • packages/core/src/v3/apiClient/index.ts
  • apps/webapp/app/presenters/v3/RegionsPresenter.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.regions.ts
  • apps/webapp/app/presenters/v3/ApiRetrieveRunPresenter.server.ts
  • packages/core/src/v3/apiClient/types.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/services/runsRepository/clickhouseRunsRepository.server.ts
  • apps/webapp/app/presenters/RunFilters.server.ts
  • packages/cli-v3/src/mcp/tools/runs.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
  • packages/core/src/v3/schemas/api.ts
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use function declarations instead of default exports

Add crumbs as you write code — not just when debugging. Mark lines with // @Crumbs or wrap blocks in `// `#region` `@crumbs. They stay on the branch throughout development and are stripped by agentcrumbs strip before merge.

Files:

  • packages/cli-v3/src/mcp/formatters.ts
  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/services/runsRepository/runsRepository.server.ts
  • packages/cli-v3/src/mcp/schemas.ts
  • apps/webapp/app/components/runs/v3/RegionLabel.tsx
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
  • packages/core/src/v3/apiClient/index.ts
  • apps/webapp/app/presenters/v3/RegionsPresenter.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.regions.ts
  • apps/webapp/app/presenters/v3/ApiRetrieveRunPresenter.server.ts
  • packages/core/src/v3/apiClient/types.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/services/runsRepository/clickhouseRunsRepository.server.ts
  • apps/webapp/app/presenters/RunFilters.server.ts
  • packages/cli-v3/src/mcp/tools/runs.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
  • packages/core/src/v3/schemas/api.ts
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/otel-metrics.mdc)

**/*.ts: When creating or editing OTEL metrics (counters, histograms, gauges), ensure metric attributes have low cardinality by using only enums, booleans, bounded error codes, or bounded shard IDs
Do not use high-cardinality attributes in OTEL metrics such as UUIDs/IDs (envId, userId, runId, projectId, organizationId), unbounded integers (itemCount, batchSize, retryCount), timestamps (createdAt, startTime), or free-form strings (errorMessage, taskName, queueName)
When exporting OTEL metrics via OTLP to Prometheus, be aware that the exporter automatically adds unit suffixes to metric names (e.g., 'my_duration_ms' becomes 'my_duration_ms_milliseconds', 'my_counter' becomes 'my_counter_total'). Account for these transformations when writing Grafana dashboards or Prometheus queries

Files:

  • packages/cli-v3/src/mcp/formatters.ts
  • apps/webapp/app/services/runsRepository/runsRepository.server.ts
  • packages/cli-v3/src/mcp/schemas.ts
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
  • packages/core/src/v3/apiClient/index.ts
  • apps/webapp/app/presenters/v3/RegionsPresenter.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.regions.ts
  • apps/webapp/app/presenters/v3/ApiRetrieveRunPresenter.server.ts
  • packages/core/src/v3/apiClient/types.ts
  • apps/webapp/app/services/runsRepository/clickhouseRunsRepository.server.ts
  • apps/webapp/app/presenters/RunFilters.server.ts
  • packages/cli-v3/src/mcp/tools/runs.ts
  • packages/core/src/v3/schemas/api.ts
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts
packages/cli-v3/src/mcp/**/*

📄 CodeRabbit inference engine (packages/cli-v3/CLAUDE.md)

Provide an MCP server implementation in src/mcp/ for AI-assisted task development

Files:

  • packages/cli-v3/src/mcp/formatters.ts
  • packages/cli-v3/src/mcp/schemas.ts
  • packages/cli-v3/src/mcp/tools/runs.ts
**/*.{ts,tsx,js,jsx,json,md,css,scss}

📄 CodeRabbit inference engine (AGENTS.md)

Code formatting is enforced using Prettier. Run pnpm run format before committing

Files:

  • packages/cli-v3/src/mcp/formatters.ts
  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/services/runsRepository/runsRepository.server.ts
  • packages/cli-v3/src/mcp/schemas.ts
  • apps/webapp/app/components/runs/v3/RegionLabel.tsx
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
  • packages/core/src/v3/apiClient/index.ts
  • apps/webapp/app/presenters/v3/RegionsPresenter.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.regions.ts
  • apps/webapp/app/presenters/v3/ApiRetrieveRunPresenter.server.ts
  • packages/core/src/v3/apiClient/types.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/services/runsRepository/clickhouseRunsRepository.server.ts
  • apps/webapp/app/presenters/RunFilters.server.ts
  • packages/cli-v3/src/mcp/tools/runs.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
  • packages/core/src/v3/schemas/api.ts
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
packages/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

When modifying any public package (packages/* or integrations/*), add a changeset using pnpm run changeset:add. Default to patch for bug fixes and minor changes; confirm with maintainers before selecting minor; never select major without explicit approval.

Files:

  • packages/cli-v3/src/mcp/formatters.ts
  • packages/cli-v3/src/mcp/schemas.ts
  • packages/core/src/v3/apiClient/index.ts
  • packages/core/src/v3/apiClient/types.ts
  • packages/cli-v3/src/mcp/tools/runs.ts
  • packages/core/src/v3/schemas/api.ts
{packages/core,apps/webapp}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use zod for validation in packages/core and apps/webapp

Files:

  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/services/runsRepository/runsRepository.server.ts
  • apps/webapp/app/components/runs/v3/RegionLabel.tsx
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
  • packages/core/src/v3/apiClient/index.ts
  • apps/webapp/app/presenters/v3/RegionsPresenter.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.regions.ts
  • apps/webapp/app/presenters/v3/ApiRetrieveRunPresenter.server.ts
  • packages/core/src/v3/apiClient/types.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/services/runsRepository/clickhouseRunsRepository.server.ts
  • apps/webapp/app/presenters/RunFilters.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
  • packages/core/src/v3/schemas/api.ts
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
apps/webapp/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/webapp.mdc)

apps/webapp/**/*.{ts,tsx}: Access environment variables through the env export of env.server.ts instead of directly accessing process.env
Use subpath exports from @trigger.dev/core package instead of importing from the root @trigger.dev/core path

Use named constants for sentinel/placeholder values (e.g. const UNSET_VALUE = '__unset__') instead of raw string literals scattered across comparisons

Files:

  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/services/runsRepository/runsRepository.server.ts
  • apps/webapp/app/components/runs/v3/RegionLabel.tsx
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
  • apps/webapp/app/presenters/v3/RegionsPresenter.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.regions.ts
  • apps/webapp/app/presenters/v3/ApiRetrieveRunPresenter.server.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/services/runsRepository/clickhouseRunsRepository.server.ts
  • apps/webapp/app/presenters/RunFilters.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
apps/webapp/**/*.{tsx,jsx}

📄 CodeRabbit inference engine (apps/webapp/CLAUDE.md)

Only use useCallback/useMemo for context provider values, expensive derived data that is a dependency elsewhere, or stable refs required by a dependency array. Don't wrap ordinary event handlers or trivial computations

Files:

  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/components/runs/v3/RegionLabel.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
apps/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

When modifying only server components (apps/webapp/, apps/supervisor/, etc.) with no package changes, add a .server-changes/ file instead of a changeset. See .server-changes/README.md for format and documentation.

Files:

  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/services/runsRepository/runsRepository.server.ts
  • apps/webapp/app/components/runs/v3/RegionLabel.tsx
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
  • apps/webapp/app/presenters/v3/RegionsPresenter.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.regions.ts
  • apps/webapp/app/presenters/v3/ApiRetrieveRunPresenter.server.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/services/runsRepository/clickhouseRunsRepository.server.ts
  • apps/webapp/app/presenters/RunFilters.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
apps/webapp/**/*.server.ts

📄 CodeRabbit inference engine (apps/webapp/CLAUDE.md)

apps/webapp/**/*.server.ts: Never use request.signal for detecting client disconnects. Use getRequestAbortSignal() from app/services/httpAsyncStorage.server.ts instead, which is wired directly to Express res.on('close') and fires reliably
Access environment variables via env export from app/env.server.ts. Never use process.env directly
Always use findFirst instead of findUnique in Prisma queries. findUnique has an implicit DataLoader that batches concurrent calls and has active bugs even in Prisma 6.x (uppercase UUIDs returning null, composite key SQL correctness issues, 5-10x worse performance). findFirst is never batched and avoids this entire class of issues

Files:

  • apps/webapp/app/services/runsRepository/runsRepository.server.ts
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
  • apps/webapp/app/presenters/v3/RegionsPresenter.server.ts
  • apps/webapp/app/presenters/v3/ApiRetrieveRunPresenter.server.ts
  • apps/webapp/app/services/runsRepository/clickhouseRunsRepository.server.ts
  • apps/webapp/app/presenters/RunFilters.server.ts
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts
packages/core/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (packages/core/CLAUDE.md)

Never import the root package (@trigger.dev/core). Always use subpath imports such as @trigger.dev/core/v3, @trigger.dev/core/v3/utils, @trigger.dev/core/logger, or @trigger.dev/core/schemas

Files:

  • packages/core/src/v3/apiClient/index.ts
  • packages/core/src/v3/apiClient/types.ts
  • packages/core/src/v3/schemas/api.ts
🧠 Learnings (14)
📚 Learning: 2026-03-22T13:26:12.060Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3244
File: apps/webapp/app/components/code/TextEditor.tsx:81-86
Timestamp: 2026-03-22T13:26:12.060Z
Learning: In the triggerdotdev/trigger.dev codebase, do not flag `navigator.clipboard.writeText(...)` calls for `missing-await`/`unhandled-promise` issues. These clipboard writes are intentionally invoked without `await` and without `catch` handlers across the project; keep that behavior consistent when reviewing TypeScript/TSX files (e.g., usages like in `apps/webapp/app/components/code/TextEditor.tsx`).

Applied to files:

  • packages/cli-v3/src/mcp/formatters.ts
  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/services/runsRepository/runsRepository.server.ts
  • packages/cli-v3/src/mcp/schemas.ts
  • apps/webapp/app/components/runs/v3/RegionLabel.tsx
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
  • packages/core/src/v3/apiClient/index.ts
  • apps/webapp/app/presenters/v3/RegionsPresenter.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.regions.ts
  • apps/webapp/app/presenters/v3/ApiRetrieveRunPresenter.server.ts
  • packages/core/src/v3/apiClient/types.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/services/runsRepository/clickhouseRunsRepository.server.ts
  • apps/webapp/app/presenters/RunFilters.server.ts
  • packages/cli-v3/src/mcp/tools/runs.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
  • packages/core/src/v3/schemas/api.ts
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
📚 Learning: 2026-03-22T19:24:14.403Z
Learnt from: matt-aitken
Repo: triggerdotdev/trigger.dev PR: 3187
File: apps/webapp/app/v3/services/alerts/deliverErrorGroupAlert.server.ts:200-204
Timestamp: 2026-03-22T19:24:14.403Z
Learning: In the triggerdotdev/trigger.dev codebase, webhook URLs are not expected to contain embedded credentials/secrets (e.g., fields like `ProjectAlertWebhookProperties` should only hold credential-free webhook endpoints). During code review, if you see logging or inclusion of raw webhook URLs in error messages, do not automatically treat it as a credential-leak/secrets-in-logs issue by default—first verify the URL does not contain embedded credentials (for example, no username/password in the URL, no obvious secret/token query params or fragments). If the URL is credential-free per this project’s conventions, allow the logging.

Applied to files:

  • packages/cli-v3/src/mcp/formatters.ts
  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/services/runsRepository/runsRepository.server.ts
  • packages/cli-v3/src/mcp/schemas.ts
  • apps/webapp/app/components/runs/v3/RegionLabel.tsx
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
  • packages/core/src/v3/apiClient/index.ts
  • apps/webapp/app/presenters/v3/RegionsPresenter.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.regions.ts
  • apps/webapp/app/presenters/v3/ApiRetrieveRunPresenter.server.ts
  • packages/core/src/v3/apiClient/types.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/services/runsRepository/clickhouseRunsRepository.server.ts
  • apps/webapp/app/presenters/RunFilters.server.ts
  • packages/cli-v3/src/mcp/tools/runs.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
  • packages/core/src/v3/schemas/api.ts
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
📚 Learning: 2026-02-11T16:37:32.429Z
Learnt from: matt-aitken
Repo: triggerdotdev/trigger.dev PR: 3019
File: apps/webapp/app/components/primitives/charts/Card.tsx:26-30
Timestamp: 2026-02-11T16:37:32.429Z
Learning: In projects using react-grid-layout, avoid relying on drag-handle class to imply draggability. Ensure drag-handle elements only affect dragging when the parent grid item is configured draggable in the layout; conditionally apply cursor styles based on the draggable prop. This improves correctness and accessibility.

Applied to files:

  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/components/runs/v3/RegionLabel.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
📚 Learning: 2026-03-22T13:32:43.005Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3244
File: apps/webapp/app/components/metrics/OperationsFilter.tsx:85-110
Timestamp: 2026-03-22T13:32:43.005Z
Learning: In triggerdotdev/trigger.dev, the shared `FilterMenuProvider` (from `~/components/runs/v3/SharedFilters`) manages Ariakit `ComboboxProvider` state internally and exposes the current `search` value and `setSearch` via render props `(search, setSearch) => …`. For filter components (e.g., `OperationsFilter`, `ModelsFilter`, `QueuesFilter`, `ProvidersFilter`), treat the render-prop tuple and their use of `searchValue={search}` and `clearSearchValue={() => setSearch("")}` as the correct wiring. Do not raise a review finding about missing/broken connection between the ComboBox input and the search state—if the component follows this provider/render-prop pattern and the `filtered` `useMemo` dependencies are reactive, the state synchronization is expected to be handled by Ariakit through the provider.

Applied to files:

  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
📚 Learning: 2026-04-16T14:21:15.229Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3368
File: apps/webapp/app/components/logs/LogsTaskFilter.tsx:135-163
Timestamp: 2026-04-16T14:21:15.229Z
Learning: When rendering lists of task registry items in apps/webapp (e.g., <SelectItem /> rows) and using `key={item.slug}`, do not flag it as potentially non-unique. In trigger.dev’s `TaskIdentifier` table, the DB constraint `@unique([runtimeEnvironmentId, slug])` guarantees `slug` is unique within a given runtime environment, so `item.slug` is safe as the React key as long as the list is derived from that registry/constraint (and not from a legacy query that could produce duplicate slugs).

Applied to files:

  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/components/runs/v3/RegionLabel.tsx
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
📚 Learning: 2026-05-08T21:00:20.973Z
Learnt from: samejr
Repo: triggerdotdev/trigger.dev PR: 3538
File: apps/webapp/app/components/primitives/Resizable.tsx:60-78
Timestamp: 2026-05-08T21:00:20.973Z
Learning: In the triggerdotdev/trigger.dev codebase, treat Zod as a boundary validation tool (API handlers, request/response validation, and storage/DB read/write validation), not as inline render-time validation inside React components/primitive UI code. For render-time guards, prefer small manual type-narrowing checks (e.g., a short predicate like ~10–20 lines) over importing Zod into UI primitives, to avoid per-render schema-parse overhead and unnecessary abstraction. Use the manual guard approach unless you truly need schema validation at a boundary; only then introduce Zod.

Applied to files:

  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/components/runs/v3/RegionLabel.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
📚 Learning: 2026-05-12T21:04:05.815Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3542
File: apps/webapp/app/components/sessions/v1/SessionStatus.tsx:1-3
Timestamp: 2026-05-12T21:04:05.815Z
Learning: In this Remix + TypeScript codebase, do not flag a server/client boundary violation when a file imports only types from a module matching `*.server`.

Specifically, it’s safe to import types using `import type { Foo } from "*.server"` or `import { type Foo } from "*.server"` because TypeScript erases type-only imports at compile time and they emit no JavaScript, so they won’t cross the Remix server/client bundle boundary.

Only raise the boundary concern for value imports (e.g., `import { Foo }` without `type`, or `import Foo`), since those produce JavaScript output.

Applied to files:

  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/services/runsRepository/runsRepository.server.ts
  • apps/webapp/app/components/runs/v3/RegionLabel.tsx
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
  • apps/webapp/app/presenters/v3/RegionsPresenter.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.regions.ts
  • apps/webapp/app/presenters/v3/ApiRetrieveRunPresenter.server.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/services/runsRepository/clickhouseRunsRepository.server.ts
  • apps/webapp/app/presenters/RunFilters.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
📚 Learning: 2026-03-26T09:02:07.973Z
Learnt from: myftija
Repo: triggerdotdev/trigger.dev PR: 3274
File: apps/webapp/app/services/runsReplicationService.server.ts:922-924
Timestamp: 2026-03-26T09:02:07.973Z
Learning: When parsing Trigger.dev task run annotations in server-side services, keep `TaskRun.annotations` strictly conforming to the `RunAnnotations` schema from `trigger.dev/core/v3`. If the code already uses `RunAnnotations.safeParse` (e.g., in a `#parseAnnotations` helper), treat that as intentional/necessary for atomic, schema-accurate annotation handling. Do not recommend relaxing the annotation payload schema or using a permissive “passthrough” parse path, since the annotations are expected to be written atomically in one operation and should not contain partial/legacy payloads that would require a looser parser.

Applied to files:

  • apps/webapp/app/services/runsRepository/runsRepository.server.ts
  • apps/webapp/app/services/runsRepository/clickhouseRunsRepository.server.ts
📚 Learning: 2026-05-05T09:38:02.512Z
Learnt from: d-cs
Repo: triggerdotdev/trigger.dev PR: 3523
File: apps/webapp/app/routes/api.v3.batches.ts:178-181
Timestamp: 2026-05-05T09:38:02.512Z
Learning: When reviewing code that catches `ServiceValidationError` in `*.server.ts` files, do not blindly forward `error.status` to HTTP responses, because SVEs may be thrown with non-default statuses (e.g., 400/500) and forwarding them can cause client-visible behavioral regressions (e.g., surfacing 500s to clients). Prefer a safe default response status of `error.status ?? 422`, but only after confirming via the reachable call graph that the caught `ServiceValidationError` instances are expected to carry those non-default statuses; otherwise, normalize to `422` to avoid unexpected client-visible 5xx behavior.

Applied to files:

  • apps/webapp/app/services/runsRepository/runsRepository.server.ts
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
  • apps/webapp/app/presenters/v3/RegionsPresenter.server.ts
  • apps/webapp/app/presenters/v3/ApiRetrieveRunPresenter.server.ts
  • apps/webapp/app/services/runsRepository/clickhouseRunsRepository.server.ts
  • apps/webapp/app/presenters/RunFilters.server.ts
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts
📚 Learning: 2026-03-22T13:32:44.229Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3244
File: apps/webapp/app/components/metrics/ProvidersFilter.tsx:74-96
Timestamp: 2026-03-22T13:32:44.229Z
Learning: When reviewing components under `apps/webapp/app/components/runs/v3/`, avoid flagging “broken/unconnected search state” in filters that use `FilterMenuProvider` wrapping Ariakit’s `ComboboxProvider` and expose `(search, setSearch)` (render props). In this intentional pattern, the `searchValue` render-prop value should be treated as reactive (it re-renders on every keystroke), passed into the dropdown child, and used in `useMemo` to filter options. Do not require additional wiring beyond this established render-prop/ComboboxProvider integration.

Applied to files:

  • apps/webapp/app/components/runs/v3/RegionLabel.tsx
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
📚 Learning: 2026-02-06T19:53:38.843Z
Learnt from: 0ski
Repo: triggerdotdev/trigger.dev PR: 2994
File: apps/webapp/app/presenters/v3/DeploymentListPresenter.server.ts:233-237
Timestamp: 2026-02-06T19:53:38.843Z
Learning: When constructing Vercel dashboard URLs from deployment IDs, always strip the dpl_ prefix from the ID. Implement this by transforming the ID with .replace(/^dpl_/, "") before concatenating into the URL: https://vercel.com/${teamSlug}/${projectName}/${cleanedDeploymentId}. Consider centralizing this logic in a small helper (e.g., getVercelDeploymentId(id) or a URL builder) and add tests to verify both prefixed and non-prefixed inputs.

Applied to files:

  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
  • apps/webapp/app/presenters/v3/RegionsPresenter.server.ts
  • apps/webapp/app/presenters/v3/ApiRetrieveRunPresenter.server.ts
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts
📚 Learning: 2026-02-03T18:27:40.429Z
Learnt from: 0ski
Repo: triggerdotdev/trigger.dev PR: 2994
File: apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.environment-variables/route.tsx:553-555
Timestamp: 2026-02-03T18:27:40.429Z
Learning: In apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.environment-variables/route.tsx, the menu buttons (e.g., Edit with PencilSquareIcon) in the TableCellMenu are intentionally icon-only with no text labels as a compact UI pattern. This is a deliberate design choice for this route; preserve the icon-only behavior for consistency in this file.

Applied to files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
📚 Learning: 2026-04-02T19:18:26.255Z
Learnt from: samejr
Repo: triggerdotdev/trigger.dev PR: 3319
File: apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions/route.tsx:179-189
Timestamp: 2026-04-02T19:18:26.255Z
Learning: In this repo’s route components that render the Inspector `ResizablePanelGroup` panels, it’s acceptable to pass `collapsed={!isShowingInspector}` together with a no-op `onCollapseChange={() => {}}` when panel visibility is intentionally controlled only by route parameters (e.g., `*Param` search/route params) rather than user drag/collapse interactions. Do not flag an empty/no-op `onCollapseChange` as “missing wiring” in these cases; only flag it when collapse state is expected to change based on user interaction.

Applied to files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
📚 Learning: 2026-05-12T21:04:00.184Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3542
File: apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.sessions._index/route.tsx:40-42
Timestamp: 2026-05-12T21:04:00.184Z
Learning: In triggerdotdev/trigger.dev route loader implementations (Remix `route.tsx` files under `apps/webapp/app/routes/**`), follow the existing convention for missing/unauthorized environment lookups: when `findEnvironmentBySlug` (or the equivalent env resolver) returns a falsy value, handle it by throwing `new Error("Environment not found")` rather than returning a `404` `Response` (i.e., do not flag this as “missing 404 response”). Changing the error-to-404 convention is a cross-cutting refactor and should be left out of individual PRs unless the PR explicitly addresses that broader migration.

Applied to files:

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
🔇 Additional comments (21)
packages/cli-v3/src/mcp/formatters.ts (1)

430-433: LGTM!

packages/cli-v3/src/mcp/schemas.ts (1)

186-191: LGTM!

packages/cli-v3/src/mcp/tools/runs.ts (1)

377-377: LGTM!

packages/core/src/v3/apiClient/index.ts (1)

2084-2089: LGTM!

.changeset/mcp-list-runs-region.md (1)

1-6: LGTM!

.changeset/runs-list-region-filter.md (1)

1-7: LGTM!

packages/core/src/v3/schemas/api.ts (1)

1137-1137: LGTM!

packages/core/src/v3/apiClient/types.ts (1)

61-62: LGTM!

apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts (1)

119-124: LGTM!

Also applies to: 264-266, 321-321

apps/webapp/app/presenters/v3/RegionsPresenter.server.ts (1)

13-13: LGTM!

Also applies to: 77-77, 101-101, 116-116, 137-137

apps/webapp/app/services/runsRepository/runsRepository.server.ts (1)

43-43: LGTM!

Also applies to: 108-108

apps/webapp/app/services/runsRepository/clickhouseRunsRepository.server.ts (1)

154-154: LGTM!

Also applies to: 328-330

apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts (1)

36-36: LGTM!

Also applies to: 76-76, 107-107, 194-194, 262-262

apps/webapp/app/presenters/v3/ApiRetrieveRunPresenter.server.ts (1)

45-45: LGTM!

Also applies to: 467-467

apps/webapp/app/presenters/RunFilters.server.ts (1)

37-37: LGTM!

Also applies to: 59-59

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.regions.ts (1)

1-42: LGTM!

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx (1)

47-47: LGTM!

Also applies to: 98-109, 128-128, 135-135, 194-194, 212-213, 218-219, 327-327

apps/webapp/app/components/runs/v3/RegionLabel.tsx (1)

1-22: LGTM!

apps/webapp/app/components/runs/v3/TaskRunsTable.tsx (1)

50-50: LGTM!

Also applies to: 76-76, 90-94, 97-97, 117-117, 244-244, 324-324, 328-328, 453-466, 493-493, 629-639, 653-653, 681-681

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx (1)

25-25: LGTM!

Also applies to: 975-975

apps/webapp/app/components/BulkActionFilterSummary.tsx (1)

218-230: LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants